<?php if(Yii::app()->user->isGuest): ?>
	<?php if(count($model->getErrors()) > 0):?>
		<div class="alert alert-danger register">
			<?php echo BSHtml::errorSummary($model); ?>
		</div>
	<?php endif;?>
	<div class="register">
		<?php echo BSHtml::beginForm(); ?>
			<fieldset>
				<legend>Регистрация</legend>
				<div class="form-group">
					<?php echo BSHtml::activeLabelEx($model,'email', array('class'=>'col-lg-3')); ?>
					<div class="col-lg-9">
						<?php echo BSHtml::activeTextField($model,'email'); ?>
					</div>
				</div>
				
				<div class="form-group">
					<?php echo BSHtml::activeLabelEx($model,'password', array('class'=>'col-lg-3')); ?>
					<div class="col-lg-9">
						<?php echo BSHtml::activePasswordField($model,'password'); ?>
					</div>
				</div>
				
				<div class="form-group">
					<?php echo BSHtml::activeLabelEx($model,'passwordConfirm', array('class'=>'col-lg-3')); ?>
					<div class="col-lg-9">
						<?php echo BSHtml::activePasswordField($model,'passwordConfirm'); ?>
					</div>
				</div>
				
				<div class="form-group">
					<?php echo BSHtml::activeLabelEx($model,'first_name', array('class'=>'col-lg-3')); ?>
					<div class="col-lg-9">
						<?php echo BSHtml::activeTextField($model,'first_name'); ?>
					</div>
				</div>
				
				<div class="form-group">
					<?php echo BSHtml::activeLabelEx($model,'last_name', array('class'=>'col-lg-3')); ?>
					<div class="col-lg-9">
						<?php echo BSHtml::activeTextField($model,'last_name'); ?>
					</div>
				</div>
				
				<div class="form-group">
					<div class="col-lg-9 col-lg-offset-3">
						<?php $this->widget('CCaptcha', array('imageOptions'=>array('class'=>'captcha-img')))?>
					</div>
				</div>
				<div class="form-group">
					<?php echo BSHtml::activeLabelEx($model, 'verifyCode', array('class'=>'col-lg-3'))?>
					<div class="col-lg-9">
						<?php echo BSHtml::activeTextField($model, 'verifyCode',array('class'=>'form-control'))?>
					</div>
				</div>
				<div class="form-group">
					<div class="col-lg-9 col-lg-offset-3 align-right">
						<td><?php echo BSHtml::link('Авторизоваться',array('/user/action/login'), array('class'=>'btn')); ?></td>
						<td><?php echo BSHtml::submitButton('Зарегистрироваться'); ?></td>
					</div>
				</div>
			</fieldset>
		<?php echo BSHtml::endForm(); ?>
	</div>
<?php else:?>
	<div class="alert alert-info">
		Вы уже зарегистрированы и авторизованы как <?php echo Yii::app()->user->getName();?>
	</div>
<?php endif;?>